home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat2 / dcntl.nr < prev    next >
Encoding:
Text File  |  1993-03-03  |  4.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. Dcntl(2)                  Dec. 12, 1991                  Dcntl(2)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        Dcntl - perform a file system specific operation on a file
  9.        or directory
  10.  
  11. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  12.        #include <filesys.h>
  13.  
  14.        LONG Dcntl( WORD cmd, char *name, LONG arg);
  15.  
  16. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  17.        _✓D_✓c_✓n_✓t_✓l performs a file system specific  command,  given  by
  18.        _✓c_✓m_✓d,  upon  the  file or directory specified by _✓n_✓a_✓m_✓e.  The
  19.        exact nature of the operation performed depends  upon  the
  20.        file  system  on which _✓n_✓a_✓m_✓e resides. The interpretation of
  21.        the third argument _✓a_✓r_✓g depends upon the specific  command.
  22.  
  23.        The  only built-in file system which supports _✓D_✓c_✓n_✓t_✓l opera-
  24.        tions is the device file system U:\DEV, which  understands
  25.        the following commands:
  26.  
  27.  
  28.        DEV_INSTALL
  29.               Installs a new device driver whose name is given by
  30.               _✓n_✓a_✓m_✓e (which must be  the  complete  path  and  file
  31.               name, e.g.  U:\DEV\FOO). The device may be accessed
  32.               only through GEMDOS file operations; the BIOS  will
  33.               not  be  aware of it.  _✓a_✓r_✓g is a pointer to a device
  34.               descriptor structure:
  35.  
  36.               struct dev_descr {
  37.                /* pointer to device driver structure */
  38.                    DEVDRV    *driver;
  39.                /* placed in the "aux" field of file cookies */
  40.                    short     dinfo;
  41.                /* either 0 or O_TTY */
  42.                    short     flags;
  43.                /* if flags&O_TTY, this points to the tty structure associated
  44.                 * with the device
  45.                 */
  46.                    struct tty *tty;
  47.                /* reserved for future expansion -- set to 0 */
  48.                    long reserved[4];
  49.               };
  50.  
  51.               If the attempt to install the device is successful,
  52.               _✓D_✓c_✓n_✓t_✓l  will  return  a  pointer to a structure with
  53.               type "struct kerinfo"  that  describes  the  kernel
  54.               (see  the  documentation  for loadable file systems
  55.               for  more  information  on  this  structure).  This
  56.               structure   is  in  protected  memory  and  can  be
  57.               accessed only in  supervisor  mode.  Moreover,  the
  58.               structure  is  read  only;  attempts to write to it
  59.               will produce unpredictable errors.  If there is not
  60.               enough  memory  to  install  the new device, a null
  61.  
  62.  
  63.  
  64. Version 0.92         MiNT Programmer's Manual                   1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Dcntl(2)                  Dec. 12, 1991                  Dcntl(2)
  71.  
  72.  
  73.               pointer will be returned.
  74.  
  75.        DEV_NEWTTY
  76.               Installs a driver for a new  BIOS  terminal  device
  77.               whose  name  is  _✓n_✓a_✓m_✓e  (this  must be the full path
  78.               name, e.g.  U:\DEV\BAR).  _✓a_✓r_✓g is  the  BIOS  device
  79.               number of this device. Note that the BIOS must have
  80.               been told about the device already via the  _✓B_✓c_✓o_✓n_✓m_✓a_✓p
  81.               system  call  or some similar mechanism; otherwise,
  82.               any attempt to access the file will  result  in  an
  83.               unknown  device error (EUNDEV). This command simply
  84.               informs the kernel about a BIOS device that already
  85.               exists, unlike DEV_INSTALL which actually creates a
  86.               new device.
  87.  
  88.  
  89.        DEV_NEWBIOS
  90.               Installs a  driver  for  a  new  BIOS  non-terminal
  91.               device  whose  name  is _✓n_✓a_✓m_✓e (this must be the full
  92.               path name, e.g.   U:\DEV\BAR).   _✓a_✓r_✓g  is  the  BIOS
  93.               device  number  of  this device. Note that the BIOS
  94.               must have been told about the  device  already  via
  95.               the  _✓B_✓c_✓o_✓n_✓m_✓a_✓p system call or some similar mechanism;
  96.               otherwise, any attempt  to  access  the  file  will
  97.               result  in  an  unknown device error (EUNDEV). Like
  98.               DEV_NEWTTY, this command informs the kernel of  the
  99.               existence  of a BIOS device. The difference between
  100.               the two commands is that DEV_NEWTTY should be  used
  101.               for  devices  which may be used as terminal devices
  102.               (e.g. serial lines), whereas DEV_NEWBIOS is  useful
  103.               for devices for which data must be always transmit-
  104.               ted "raw" (e.g. a SCSI tape device,  or  perhaps  a
  105.               LAN device).
  106.  
  107.  
  108. R✓RE✓ET✓TU✓UR✓RN✓NS✓S
  109.        The  value  returned  depends  on  the  specific operation
  110.        requested and the file system involved. Generally, a 0  or
  111.        positive  return value should mean success, and a negative
  112.        one  failure.  An  exception  is  the  value  returned  by
  113.        DEV_INSTALL,  which is either a pointer to a kernel infor-
  114.        mation structure, or null on failure.
  115.  
  116. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  117.        _✓B_✓c_✓o_✓n_✓m_✓a_✓p(2), _✓F_✓c_✓n_✓t_✓l(2)
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. Version 0.92         MiNT Programmer's Manual                   2
  131.  
  132.  
  133.